how to open baseline in specific existing view

Dear Forum-mates,

there is a module, it was baselined and it has many views.
I want to open the baselined version of the module in a specific view and NOT in default(for module/user).

My thoughts were (indeed it opens the proper baseline but in the module-default view):

Module   m = read("/level1/level2/my_module", false)
Baseline b = baseline(0,4,"BASELINESET_MY_MODULE")
View     v = view("view to want")
 
if (baselineExists(m,b)){
 
    load(m,v)
    load(m,b,true)
 
//    load(m,b,true)
//    load(m,v)
 
}


The out-commented version isn't right also.
How can I load the view I want to see?

Thank You in advance,
vasgyuszi


vasgyuszi - Tue Apr 20 04:28:30 EDT 2010

Re: how to open baseline in specific existing view
kabr - Tue Apr 20 04:49:59 EDT 2010

Hi vasgyuszi,

your code

Module m = current 
Baseline b = baseline(1,2,null) 
View v = view("viewname") 
 
if (baselineExists(m,b)) { 
    load(m,b, true) 
        load(m,v)
}


first loads the baseline
and next loads the view in the current module
to load the view in the opened baseline
use

 

Module m = current 
Baseline b = baseline(1,2,null) 
View v = view("92 WEXP Setup") 
 
if (baselineExists(m,b)) { 
    load(m,b, true) 
        load v 
}


this should work.

rgds
Karl

 

Re: how to open baseline in specific existing view
vasgyuszi - Tue Apr 20 05:50:26 EDT 2010

kabr - Tue Apr 20 04:49:59 EDT 2010

Hi vasgyuszi,

your code

Module m = current 
Baseline b = baseline(1,2,null) 
View v = view("viewname") 
 
if (baselineExists(m,b)) { 
    load(m,b, true) 
        load(m,v)
}


first loads the baseline
and next loads the view in the current module
to load the view in the opened baseline
use

 

Module m = current 
Baseline b = baseline(1,2,null) 
View v = view("92 WEXP Setup") 
 
if (baselineExists(m,b)) { 
    load(m,b, true) 
        load v 
}


this should work.

rgds
Karl

 

Thank You Karl,

it works!

Let me allow a further question: how would be looking this for three modules?

Because my solution doesn't working in that case:

Module m1 = read("/lev1/lev2/m1", false),
       m2 = read("/lev1/lev2/m2", false),
       m3 = read("/lev1/lev2/m3", false)
 
Baseline b = baseline(0,3,"baseline_suffix")
 
View v = view("desiredView")
 
if (baselineExists(m1,b)&&baselineExists(m2,b)&&baselineExists(m3,b)){
 
    
    m1 = current
    load(m1,b,true)
    load v
 
    m2 = current
    load(m2,b,true)
    load v
 
    m3 = current
    load(m3,b,true)
    load v
 
}

 


Of course I could repeat your working solution:

 

 

Module m = read("/lev1/lev2/m", false)
Baseline b = baseline(0,6,"suffix_name")
View v = view("myView")
if (baselineExists(m,b)){
    load(m,b,true)
    load v
}


three times each after for all affected modules, but it wouldn't be nice.

THX!
vasgyuszi

 

Re: how to open baseline in specific existing view
vasgyuszi - Tue Apr 20 06:12:05 EDT 2010

vasgyuszi - Tue Apr 20 05:50:26 EDT 2010

Thank You Karl,

it works!

Let me allow a further question: how would be looking this for three modules?

Because my solution doesn't working in that case:

Module m1 = read("/lev1/lev2/m1", false),
       m2 = read("/lev1/lev2/m2", false),
       m3 = read("/lev1/lev2/m3", false)
 
Baseline b = baseline(0,3,"baseline_suffix")
 
View v = view("desiredView")
 
if (baselineExists(m1,b)&&baselineExists(m2,b)&&baselineExists(m3,b)){
 
    
    m1 = current
    load(m1,b,true)
    load v
 
    m2 = current
    load(m2,b,true)
    load v
 
    m3 = current
    load(m3,b,true)
    load v
 
}

 


Of course I could repeat your working solution:

 

 

Module m = read("/lev1/lev2/m", false)
Baseline b = baseline(0,6,"suffix_name")
View v = view("myView")
if (baselineExists(m,b)){
    load(m,b,true)
    load v
}


three times each after for all affected modules, but it wouldn't be nice.

THX!
vasgyuszi

 

The only way I've found looks like:

void doIt (Module m, View v, Baseline b)
    {
        if (baselineExists(m,b)){
            load(m,b,true)
            load v
        }
    }
Module   m
View     v
Baseline b = baseline(0,2,"sfx")
 
m = read("/lev1/lev2/m1", false)
v = view("myView")
doIt(m,v,b)
 
 
m = read("/lev1/lev2/m2", false)
v = view("myView")
doIt(m,v,b)
 
m = read("/lev1/lev2/m3", false)
v = view("myView")
doIt(m,v,b)

 


Best regards,
vasgyuszi

 

Re: how to open baseline in specific existing view
kabr - Tue Apr 20 07:22:14 EDT 2010

vasgyuszi - Tue Apr 20 06:12:05 EDT 2010

The only way I've found looks like:

void doIt (Module m, View v, Baseline b)
    {
        if (baselineExists(m,b)){
            load(m,b,true)
            load v
        }
    }
Module   m
View     v
Baseline b = baseline(0,2,"sfx")
 
m = read("/lev1/lev2/m1", false)
v = view("myView")
doIt(m,v,b)
 
 
m = read("/lev1/lev2/m2", false)
v = view("myView")
doIt(m,v,b)
 
m = read("/lev1/lev2/m3", false)
v = view("myView")
doIt(m,v,b)

 


Best regards,
vasgyuszi

 

Hi vasgyuszi,
your last version looks ok to me, although it may not be the most elegant solution.
I'm not an expert, but I would probably put the modules, views and baselines into skip lists, iterate them in a for loop and call the doIt for each set.
Karl

Re: how to open baseline in specific existing view
vasgyuszi - Tue Apr 20 07:29:41 EDT 2010

kabr - Tue Apr 20 07:22:14 EDT 2010
Hi vasgyuszi,
your last version looks ok to me, although it may not be the most elegant solution.
I'm not an expert, but I would probably put the modules, views and baselines into skip lists, iterate them in a for loop and call the doIt for each set.
Karl

Ach, yeah, the famous skipList, a kind of 'struct' containing various data types.
Not tried yet (I'm also not an expert) but seems to be essential in DXL.

Best regards, and thanks for the qick help!

vasgyuszi